home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
68hc11
/
smallc11.arc
/
CC1.C
next >
Wrap
Text File
|
1988-07-04
|
3KB
|
101 lines
/*
** Small-C Compiler Version 2.0
**
** COPYRIGHT 1982 J. E. HENDRIX
**
** PC version Feb 11 1987 Jrd
**
** TURBO-C Version july 4 1988 hm
**
** - input, input2, output, listfp converted to FILE *ptr
** - const converted to const1
** Part 1
*/
#include <stdio.h>
#include "ccdef.c"
/*
** miscellaneous storage
*/
char
alarm, /* audible alarm on errors? */
monitor, /* monitor function headers? */
pause, /* pause for operator on errors? */
stage[STAGESIZE],
symtab[SYMTBSZ],
litq[LITABSZ],
macq[MACQSIZE],
pline[LINESIZE],
mline[LINESIZE],
swq[SWTABSZ],
*line, /* points to pline or mline */
*lptr, /* ptr to either */
*glbptr, /* ptrs to next entries */
*locptr, /* ptr to next local symbol */
*stagenext,/* next addr in stage */
*stagelast,/* last addr in stage */
quote[2], /* literal string for '"' */
*cptr, /* work ptrs to any char buffer */
*cptr2,
*cptr3,
msname[NAMESIZE], /* macro symbol name array */
ssname[NAMESIZE]; /* static symbol name array */
int
reperr, /* report errors in compile -hm */
nogo, /* > 0 disables goto statements */
noloc, /* > 0 disables block locals */
(*op[16])(), /* function addresses of binary operators */
(*op2[16])(), /* same for unsigned operators */
opindex, /* index to matched operator */
opsize, /* size of operator in bytes */
swactive, /* true inside a switch */
swdefault,/* default label #, else 0 */
*swnext, /* address of next entry */
*swend, /* address of last table entry */
wq[WQTABSZ],
argcs, /* static argc */
*argvs, /* static argv */
*wqptr, /* ptr to next entry */
litptr, /* ptr to next entry */
macptr, /* macro buffer index */
mack, /* variable k for findmac routine */
pptr, /* ptr to parsing buffer */
(*oper)(), /* address of binary operator function */
ch, /* current character of line being scanned */
nch, /* next character of line being scanned */
declared, /* # of local bytes declared, else -1 when done */
iflevel, /* #if... nest level */
skiplevel,/* level at which #if... skipping started */
func1, /* true for first function */
nxtlab, /* next avail label # */
litlab, /* label # assigned to literal pool */
beglab, /* beginning label -- first function */
csp, /* compiler relative stk ptr */
argstk, /* function arg sp */
argtop,
ncmp, /* # open compound statements */
errflag, /* non-zero after 1st error in statement */
eof, /* set non-zero on final input eof */
files, /* non-zero if file list specified on cmd line */
filearg, /* cur file arg index */
glbflag, /* non-zero if internal globals */
ctext, /* non-zero to intermix c-source */
ccode, /* non-zero while parsing c-code */
/* zero when passing assembly code */
lastst, /* last executed statement type */
*iptr; /* work ptr to any int buffer */
FILE
*input, /* fd # for input file */
*input2, /* fd # for "include" file */
*output, /* fd # for output file */
*listfp; /* file pointer to list device */
int showcode; /* show c-code in assembler file -hm */
#include "cc11.c"
#include "cc12.c"
#include "cc13.c"